// 咖啡机类
class CoffeeMachine {
    private boolean isGround = false;

    public void grindBeans() {
        System.out.println("磨豆中...");
        this.isGround = true;
    }

    public Worker brew() {
        if (this.isGround) {
            System.out.println("冲泡咖啡...");
            return new Worker();
        } else {
            System.out.println("请先磨豆！");
            return null;
        }
    }
}

// 工作人员类
class Worker {
    private boolean hasMilk = false;

    public void addMilk() {
        System.out.println("加入牛奶...");
        this.hasMilk = true;
    }

    public void stir() {
        if (this.hasMilk) {
            System.out.println("搅拌完成！拿铁好了！");
        } else {
            System.out.println("请先加牛奶！");
        }
    }
}

public class CoffeeMakerOOP {
    public static void main(String[] args) {
        CoffeeMachine machine = new CoffeeMachine();
        machine.grindBeans();
        Worker worker = machine.brew();
        if (worker != null) {
            worker.addMilk();
            worker.stir();
        }
    }
}